﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe xmlns="http://schemas.microsoft.com/pag/gax-core" xmlns:xi="http://www.w3.org/2001/XInclude">
	<Arguments>
		<Argument Name="Name">
			<Converter Type="EntLibNamespaceIdentifierStringConverter"/>
			<ValueProvider Type="Evaluator" Expression="$(safeprojectname)"/>
		</Argument>
		<Argument Name="Caption">
			<ValueProvider Type="Evaluator" Expression="$(Name)">
				<MonitorArgument Name="Name" />
			</ValueProvider>
		</Argument>
		<Argument Name="NameWithoutDots">
			<ValueProvider Type="Evaluator" Expression="$(Name.Replace('.','_').Replace(' ','_'))">
				<MonitorArgument Name="Name" />
			</ValueProvider>
		</Argument>
		<Argument Name="ProjectName">
			<ValueProvider Type="Evaluator" Expression="$(Name)">
				<MonitorArgument Name="Name" />
			</ValueProvider>
		</Argument>
		<Argument Name="Namespace">
			<Converter Type="EntLibNamespaceIdentifierStringConverter"/>
			<ValueProvider Type="Evaluator" Expression="$(Name)">
				<MonitorArgument Name="Name" />
			</ValueProvider>
		</Argument>
		<Argument Name="Author">
			<ValueProvider Type="DefaultAuthorValueProvider" />
		</Argument>
		<Argument Name="DestinationDirectory">
			<ValueProvider Type="Evaluator" Expression="$(destinationdirectory)"/>
		</Argument>
		<xi:include href="CommonAddReferences.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(gax:Recipe/gax:Arguments/gax:Argument)" />
		<Argument Name="RuntimeProjectName">
			<ValueProvider Type="ArgumentExpressionProvider" Expression="$RootSolutionFolderName$\$ProjectName$"/>
		</Argument>
		<Argument Name="RuntimeTestProjectName">
			<ValueProvider Type="ArgumentExpressionProvider" Expression="$RootSolutionFolderName$\Unit Tests\$ProjectName$.Tests"/>
		</Argument>
		<Argument Name="DesignTimeProjectName">
			<ValueProvider Type="ArgumentExpressionProvider" Expression="$RootSolutionFolderName$\Design\$ProjectName$.Configuration.Design"/>
		</Argument>
		<Argument Name="DesignTimeTestProjectName">
			<ValueProvider Type="ArgumentExpressionProvider" Expression="$RootSolutionFolderName$\Unit Tests\$ProjectName$.Configuration.Design.Tests"/>
		</Argument>
		<Argument Name="RuntimeProject" Type="EnvDTE.Project, EnvDTE">
			<Converter Type="ProjectConverter" />
			<ValueProvider Type="ProjectByPathExpressionProvider" PathExpression="$(RuntimeProjectName)" Stage="OnBeforeActions" />
		</Argument>
		<Argument Name="RuntimeTestProject" Type="EnvDTE.Project, EnvDTE">
			<Converter Type="ProjectConverter" />
			<ValueProvider Type="ProjectByPathExpressionProvider" PathExpression="$(RuntimeTestProjectName)" Stage="OnBeforeActions" />
		</Argument>
		<Argument Name="DesignTimeProject" Type="EnvDTE.Project, EnvDTE">
			<Converter Type="ProjectConverter" />
			<ValueProvider Type="ProjectByPathExpressionProvider" PathExpression="$(DesignTimeProjectName)" Stage="OnBeforeActions" />
		</Argument>
		<Argument Name="DesignTimeTestProject" Type="EnvDTE.Project, EnvDTE">
			<Converter Type="ProjectConverter" />
			<ValueProvider Type="ProjectByPathExpressionProvider" PathExpression="$(DesignTimeTestProjectName)" Stage="OnBeforeActions" />
		</Argument>
		<Argument Name="DesignTimeResources" Type="ProjectItem">
			<ValueProvider Type="ProjectItemByFullNameProvider"
                     ProjectArgumentName="DesignTimeProject"
                     ItemFullName="Resources.resx"
                     />
		</Argument>
	</Arguments>
	<Actions>
		<Action Name="CreateLibDirectory" Type="CreateSolutionDirectory" DirectoryName="Lib">
			<Input Name="ParentDirectory" RecipeArgument="DestinationDirectory" />
			<Output Name="NewDirectory" />
		</Action>
		<Action		Name="CopyCommonAssembly" Type="CopyFile"
					 FileName="Microsoft.Practices.EnterpriseLibrary.Common.dll"
					 ErrorMessage="The source file {0} can't be copied to the destination file {1}"
					 >
			<Input  Name="SourcePath" RecipeArgument="EnterpriseLibraryBinariesDirectory" />
			<Input  Name="DestinationPath" ActionOutput="CreateLibDirectory.NewDirectory" />
		</Action>
		<Action		Name="CopyObjectBuilderAssembly" Type="CopyFile"
					 FileName="Microsoft.Practices.ObjectBuilder.dll"
					 ErrorMessage="The source file {0} can't be copied to the destination file {1}">
			<Input  Name="SourcePath" RecipeArgument="EnterpriseLibraryBinariesDirectory" />
			<Input  Name="DestinationPath" ActionOutput="CreateLibDirectory.NewDirectory" />
		</Action>
		<Action		Name="CopyConfigurationDesignAssembly" Type="CopyFile"
					 FileName="Microsoft.Practices.EnterpriseLibrary.Configuration.Design.dll"
					 ErrorMessage="The source file {0} can't be copied to the destination file {1}">
			<Input  Name="SourcePath" RecipeArgument="EnterpriseLibraryBinariesDirectory" />
			<Input  Name="DestinationPath" ActionOutput="CreateLibDirectory.NewDirectory" />
		</Action>
		<Action Name="AddRuntimeDependencyToDesignTime"
						Type="AddProjectReferenceAction">
			<Input Name="ReferencedProject" RecipeArgument="RuntimeProject" />
			<Input Name="ReferringProject" RecipeArgument="DesignTimeProject" />
		</Action>
		<Action Name="AddRuntimeDependencyToRuntimeTest"
						Type="AddProjectReferenceAction">
			<Input Name="ReferencedProject" RecipeArgument="RuntimeProject" />
			<Input Name="ReferringProject" RecipeArgument="RuntimeTestProject" />
		</Action>
		<Action Name="AddRuntimeDependencyToDesignTimeTest"
						Type="AddProjectReferenceAction">
			<Input Name="ReferencedProject" RecipeArgument="RuntimeProject" />
			<Input Name="ReferringProject" RecipeArgument="DesignTimeTestProject" />
		</Action>
		<Action Name="AddDesignTimeDependencyToDesignTimeTest"
						Type="AddProjectReferenceAction">
			<Input Name="ReferencedProject" RecipeArgument="DesignTimeProject" />
			<Input Name="ReferringProject" RecipeArgument="DesignTimeTestProject" />
		</Action>
		<Action Name="AddAddApplicationBlockResource" Type="AddResource"
						ResourceName="Add$NameWithoutDots$"
						ResourceValue="Add $NameWithoutDots$"
						RunCustomTool="false">
			<Input Name="Resources" RecipeArgument="DesignTimeResources" />
		</Action>
		<Action Name="AddApplicationBlockResource" Type="AddResource"
						ResourceName="$NameWithoutDots$"
						ResourceValue="$NameWithoutDots$" >
			<Input Name="Resources" RecipeArgument="DesignTimeResources" />
		</Action>
		<xi:include href="CommonTodoComments.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Recipe/gax:Actions/gax:Action)" />
	</Actions>
</Recipe>